package com.blank.black.enums;

public enum LogicEnum {
    AND(1, "and"),
    OR(2, "or"),
    ;

    private Integer code;

    private String name;

    LogicEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getLogicName(Integer code) {
        if (code.equals(AND.getCode())) {
            return AND.getName();
        }
        return OR.getName();
    }

    public static LogicEnum getLogic(Integer code) {
        if (code.equals(AND.getCode())) {
            return AND;
        }
        return OR;
    }


}
